export default class Dep{
    constructor() {
        // 订阅的数组
        this.subs = [];
    }

    addSub(watcher){
        this.subs.push(watcher);
    }

    notify(){
        this.subs.forEach(watcher=>watcher.update());
    }
}